import { useLocation } from "umi";

// 获取是否登录的状态的useAuth
export const useAuth = () => {
  const location = useLocation();
  //   if (location.pathname !== "/home") {
  //     return { isLogin: true };
  //   }
  if (/^\/home/.test(location.pathname)) {
    let f = sessionStorage.getItem("isLogin");
    return { isLogin: f ? JSON.parse(f) : false };
  } else {
    return { isLogin: true };
  }
};
